<div class="userinfo">

	<div class="top">

		<div class="welcome float-left">
			<?php echo Yii::t('app','Welcome'); ?> <strong><?php echo Yii::app()->user->getNameString(); ?></strong>!
		</div>

		<div class="logout float-right">
			<?php echo CHtml::link(Yii::t('app','Logout'),array('//site/logout')); ?>
		</div>

		<div class="clear">&nbsp;</div>

	</div>

	<?php if($this->reservations->getData()!==array()): ?>

		<hr />

		<div class="reservations">

			<p class="tip"><?php echo Yii::t('app','You have reserved the following items'); ?>:</p>

			<?php $this->widget('zii.widgets.grid.CGridView',array(
				'id'=>'reservation-grid',
				'dataProvider'=>$this->reservations,
				'template'=>'{items}',
				'hideHeader'=>true,
				'columns'=>array(
					array(
						'type'=>'raw',
						'value'=>'\'<strong>\'.$data->quantity.\'</strong> x \'.CHtml::link($data->item->product->name,array(\'//site/catalog\',\'#\'=>\'product-\'.$data->item->product->id))',
						'htmlOptions'=>array('class'=>'name-column'),
					),
					array(
						'type'=>'raw',
						'value'=>'CHtml::link(Yii::t(\'app\',\'Cancel Reservation\'),
							array(\'//reservation/cancel\',\'id\'=>$data->id),
							array(\'confirm\'=>Yii::t(\'app\',\'Are you sure you want to cancel this reservation\').\'?\'))',
						'htmlOptions'=>array('class'=>'cancel-column'),
					)
				),
			)); ?>

			<div class="buttons text-right">

				<?php $this->widget('zii.widgets.jui.CJuiButton', array(
					'name'=>'print-button',
					'buttonType'=>'button',
					'caption'=>Yii::t('app','Print Reservations'),
					'onclick'=>"js:
function() {
	window.open('".Yii::app()->createUrl('//reservation/print')."');
}",
				)); ?>

			</div>

		</div>

	<?php endif; ?>

</div>